package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementPortEthL3Mapper;
import com.ruoyi.net.domain.ElementPortEthL3;
import com.ruoyi.net.service.IElementPortEthL3Service;

/**
 * 网元-接口-以太网L3Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementPortEthL3ServiceImpl implements IElementPortEthL3Service 
{
    @Autowired
    private ElementPortEthL3Mapper elementPortEthL3Mapper;

    /**
     * 查询网元-接口-以太网L3
     * 
     * @param id 网元-接口-以太网L3主键
     * @return 网元-接口-以太网L3
     */
    @Override
    public ElementPortEthL3 selectElementPortEthL3ById(String id)
    {
        return elementPortEthL3Mapper.selectElementPortEthL3ById(id);
    }

    /**
     * 查询网元-接口-以太网L3列表
     * 
     * @param elementPortEthL3 网元-接口-以太网L3
     * @return 网元-接口-以太网L3
     */
    @Override
    public List<ElementPortEthL3> selectElementPortEthL3List(ElementPortEthL3 elementPortEthL3)
    {
        return elementPortEthL3Mapper.selectElementPortEthL3List(elementPortEthL3);
    }

    /**
     * 新增网元-接口-以太网L3
     * 
     * @param elementPortEthL3 网元-接口-以太网L3
     * @return 结果
     */
    @Override
    public int insertElementPortEthL3(ElementPortEthL3 elementPortEthL3)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementPortEthL3.getId())) {
            elementPortEthL3.setId(uuid);
        }
        elementPortEthL3.setCreateBy(SecurityUtils.getUsername());
        elementPortEthL3.setCreateTime(DateUtils.getNowDate());
        elementPortEthL3.setUpdateBy(SecurityUtils.getUsername());
        elementPortEthL3.setUpdateTime(DateUtils.getNowDate());
        return elementPortEthL3Mapper.insertElementPortEthL3(elementPortEthL3);
    }

    /**
     * 修改网元-接口-以太网L3
     * 
     * @param elementPortEthL3 网元-接口-以太网L3
     * @return 结果
     */
    @Override
    public int updateElementPortEthL3(ElementPortEthL3 elementPortEthL3)
    {
        elementPortEthL3.setUpdateBy(SecurityUtils.getUsername());
        elementPortEthL3.setUpdateTime(DateUtils.getNowDate());
        return elementPortEthL3Mapper.updateElementPortEthL3(elementPortEthL3);
    }

    /**
     * 批量删除网元-接口-以太网L3
     * 
     * @param ids 需要删除的网元-接口-以太网L3主键
     * @return 结果
     */
    @Override
    public int deleteElementPortEthL3ByIds(String[] ids)
    {
        return elementPortEthL3Mapper.deleteElementPortEthL3ByIds(ids);
    }

    /**
     * 删除网元-接口-以太网L3信息
     * 
     * @param id 网元-接口-以太网L3主键
     * @return 结果
     */
    @Override
    public int deleteElementPortEthL3ById(String id)
    {
        return elementPortEthL3Mapper.deleteElementPortEthL3ById(id);
    }
}
